#-*- coding:utf-8 -*-
# alist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
import json
import xlrd
import requests
from urllib.parse import urlparse

num_val = 13
print(f'{num_val % 2 = }')

# url = 'http://www.eie.cn/list1.html'
# domain = '{}://{}'.format(urlparse(url).scheme, urlparse(url).netloc)
# print(urlparse(url).netloc)

# string = "sitemap.php"
# if not string.endswith(".php") :
#     print("good")


# rootpath = "D:\\Go"

# data = xlrd.open_workbook(rootpath + '/test.xls')
# table_index = data.sheet_by_name('Sheet1')
# rows_values = table_index.row_values(2)
# print(rows_values)

# result = {}
# result["errno"] = "2"
# result["aeason"] = "schema file parse file解析错误"
# data = json.dumps(result,sort_keys=True, indent=2, separators=(',', ':'),ensure_ascii=False)
# data = json.dumps(result)
# print(data)
# import mysql.connector as mysql

# config = {
#     'host':"localhost",
#     'port':"3306",
#     'user':"root",
#     'passwd':"root",
#     'database':"05hbcms",
#     'charset':'utf-8'
# }

# db = mysql.connect(**config)

# mycursor = db.cursor()

# # 使用execute方法执行SQL语句
# mycursor.execute("SELECT VERSION()")

# # 使用 fetchone() 方法获取一条数据
# data = mycursor.fetchone()
# print("Database version : %s " % data)

# mycursor.execute("select * from hb_archive")
# result = mycursor.fetchall()

# for x in result:
#     print(x[2])

# print(alist[-3:2:-1])

# import sqlite3

# db = sqlite3.connect("D:\\Go\\image\\test.db")
# print("Opened database successfully")
# c = db.cursor()
# c.execute('''CREATE TABLE COMPANY
#        (ID INT PRIMARY KEY     NOT NULL,
#        NAME           TEXT    NOT NULL,
#        AGE            INT     NOT NULL,
#        ADDRESS        CHAR(50),
#        SALARY         REAL);''')
# print("Table created successfully")
# c.execute("INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) \
#       VALUES (4, 'Mark', 25, 'Rich-Mond ', 65000.00 )")
# db.commit()
# print("Records created successfully")

# cur = c.execute("select * from COMPANY")
# res = cur.fetchall()
# for one in res:
#     print(one[1])

# db.close()